﻿using System;

namespace KuiHuaBaoDian.Services.Animation {

    /// <summary>
    /// 动画句柄
    /// </summary>
    public readonly struct AnimationHandle {

        /// <summary>
        /// 空值
        /// </summary>
        public static readonly AnimationHandle None = new();

        /// <summary>
        /// GUID
        /// </summary>
        public Guid GUID { get; init; }

        public override readonly string ToString() => $"[{nameof(AnimationHandle)}({GUID})]";

        public override readonly int GetHashCode() => GUID.GetHashCode();

        public override readonly bool Equals(object obj) {
            if (obj is AnimationHandle other) {
                return other.GUID == GUID;
            }
            return false;
        }
    }
}
